package com.itfitness.cameraview;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.itfitness.cameraview.widget.camera.ScanningCameraView;

public class ScanningCardOcrActivity extends AppCompatActivity{
    private ScanningCameraView scanningCameraView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scanning);
        initView();
    }
    private void initView(){
        scanningCameraView = (ScanningCameraView) findViewById(R.id.camera2);
        scanningCameraView.setmResultCallBack(new ScanningCameraView.ResultCallBack() {
            @Override
            public void onSuccess(String result) {
                LogUtils.eTag("华为识别结果",result);
                ToastUtils.showShort(result);
                Intent intent = new Intent(ScanningCardOcrActivity.this, MainActicity.class);//跳转
                intent.putExtra("idCard",result);
                startActivity(intent);
                finish();
            }
        });
    }
}
